package com.example.front.dao;


import com.example.gok_mall.entity.OrderItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface OrderItemDao {
    int deleteByPrimaryKey(Integer id);

    int insert(OrderItem record);

    int insertSelective(OrderItem record);

    OrderItem selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(OrderItem record);

    int updateByPrimaryKey(OrderItem record);

    //根据用户的Id和订单号获取订单详情
    List<OrderItem> getByOrderNoUserId(@Param("orderNo") Long orderNo,@Param("userId") Integer userId);

    //根据用户的Id和订单号获取订单详情(管理员查询)
    List<OrderItem> getAllByOrderNo(Long orderNo);

    //批量插入订单中的商品信息
    void batchInsert(@Param("orderItemList") List<OrderItem> orderItemList);


}